<?php

class Form_Admin_Company extends Form_Custom_General {

    public function init() {
		
		$comp_client_id = $this->createElement("select", "comp_client_id")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($comp_client_id);
		
		$comp_name = $this->createElement("text", "comp_name")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter company name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Company Name"));
        $this->addElement($comp_name);
		
		$comp_responsible_person = $this->createElement("text", "comp_responsible_person")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Responsible Person"));
        $this->addElement($comp_responsible_person);
		
		$comp_type = $this->createElement("select", "comp_type")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($comp_type);
		
		$comp_industry = $this->createElement("select", "comp_industry")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($comp_industry);
		
		$comp_currency = $this->createElement("select", "comp_currency")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Currency"));
        $this->addElement($comp_currency);
		
		$comp_comment = $this->createElement("textarea", "comp_comment")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter date of birth")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control ","cols" => "15", "rows" => "4","placeholder"=>"Comment"));
        $this->addElement($comp_comment);
		
		$comp_available_to_everyone = $this->createElement("text", "comp_available_to_everyone")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control ","placeholder"=>""));
        $this->addElement($comp_available_to_everyone);
		
		$comp_email = $this->createElement('text', 'comp_email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Email address should not be blank.')))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "form-control"));
        $comp_email->getValidator('emailAddress')->setMessage("Email address is not valid.", Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($comp_email);
		
		$comp_phone = $this->createElement("text", "comp_phone")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter phone number")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Phone Number"));
        $this->addElement($comp_phone);
		
		$comp_site = $this->createElement("text", "comp_site")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Site"));
        $this->addElement($comp_site);
		
		$comp_adrline1 = $this->createElement("text", "comp_adrline1")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Address1"));
        $this->addElement($comp_adrline1);
		
		$comp_adrline2 = $this->createElement("text", "comp_adrline2")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Address2"));
        $this->addElement($comp_adrline2);
		
		$comp_adrline3 = $this->createElement("text", "comp_adrline3")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "r")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Address3"));
        $this->addElement($comp_adrline3);
		
		$comp_street = $this->createElement("text", "comp_street")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Street"));
        $this->addElement($comp_street);
		
		$comp_postal = $this->createElement("text", "comp_postal")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Postal"));
        $this->addElement($comp_postal);

		$comp_city = $this->createElement("text", "comp_city")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"City"));
        $this->addElement($comp_city);
		
		$comp_country = $this->createElement("text", "comp_country")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Country"));
        $this->addElement($comp_country);
		
		$comp_payment_details = $this->createElement("text", "comp_payment_details")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Payment Detail"));
        $this->addElement($comp_payment_details);
		
        $comp_addedby = $this->createElement('text', 'comp_addedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control", "readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($comp_addedby);
        
        $comp_updatedby = $this->createElement('text', 'comp_updatedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control","readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($comp_updatedby);
		
		$comp_status = $this->createElement("select", "comp_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Status"));
		$this->addElement($comp_status);
		
		$submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }
}